package com.xh.common;

import org.springframework.http.HttpStatus;

public enum ExceptionEnum {

    BAD_REQUEST(HttpStatus.BAD_REQUEST.value(), "参数异常"),
    DATA_NULL(404, "数据不存在"),
    DO_SOMETHING_ERR(501, "执行程序异常"),//描述可另行定义
    ERROR(500, "失败");
    private final int code;
    private final String describe;

    ExceptionEnum(int code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    public int getCode() {
        return code;
    }

    public String getDescribe() {
        return describe;
    }
}
